home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 43.zip / CU Amiga 15b.adf / houseinvq.doc < prev    next >
Text File  |  1991-06-04  |  10KB  |  210 lines

  1.                               Query Instructions
  2.        
  3.        
  4.        The Query program will  allow  you  to  produce a report based on
  5.        your selection,  sorting  and  formatting  specifications.   Upon
  6.        entry, you will be presented  with  a  data dictionary and string
  7.        gadgets  for  entering  your  record   selection  criteria,  sort
  8.        sequence and output report format.
  9.        
  10.        The data dictionary presents  you  with a list of data names that
  11.        can be used to display or print values contained in the database.
  12.        
  13.        The Select string gadget will allow you to specify some selection
  14.        criteria to be used to determine which  database  entries will be
  15.        included in you output display or report.  For example,
  16.        
  17.             SELECT:
  18.             (Article  = "computer" or "printer") and Orig > 1000.00
  19.        
  20.        specifies that the database  is  to  be  searched for any Article
  21.        that contains the words "computer"  or "printer" that also has an
  22.        Original Cost greater  than  $1,000.   Remember  that in order to
  23.        enter data into  a  string  gadget  you  must  first position the
  24.        pointer within the gadget  and  depress  the  left  button on the
  25.        mouse.  Note that the Select  parameters  contain  parentheses to
  26.        prevent ambiguities.  If there is a possibility that the key word
  27.        or phrase you are looking  for  contains  occurrences  with  both
  28.        upper and lower case  letters,  you  must  check  for both, e.g.,
  29.        "Computer" or  "computer".   Another  method  is  to use the wild
  30.        character, e.g., "?omputer".
  31.        
  32.        The Sort string gadget will allow  you to specify the sequence in
  33.        which the selected records are  to  be displayed or printed.  For
  34.        example,
  35.        
  36.             SORT:
  37.             Article
  38.        
  39.        specifies that the selected database  entries are to be sorted in
  40.        Article name sequence.  Only one sort field may be entered.
  41.        
  42.        The Report string gadget will allow  you to specify the format of
  43.        the output display or report.  For example,
  44.        
  45.             REPORT:
  46.             Article, col 22, Description, col 70, Orig
  47.        
  48.        specifies that the Article  name,  Description  and Original cost
  49.        for the selected records  are  to  be  displayed.  Further, it is
  50.        specified that the Description  is  to  be displayed beginning in
  51.        column 22 and that the Original cost is to be displayed beginning
  52.        in column 70.  The Report  specification  parameters  may be very
  53.        simple or very  complex  depending  upon  the  skill of the user.
  54.        Upon entering the Query  program,  you  will find that the Report
  55.        string gadget already  contains  some  parameters.   You  may use
  56.        these parameters or enter your customized  report specifications.
  57.        To erase the content on the  Report  string  gadget, first select
  58.        the gadget and then depress  Right  AMIGA  - X.  To undo (cancel)
  59.        the last editing change to the  string,  depress Right AMIGA - Q.
  60.        The Report specification  parameters  can be classified as either
  61.        describing "when to do it" or "what to do".
  62.        
  63.        When To Do It:
  64.                 
  65.                 page_top - specifies that the following functions are to
  66.                 be executed at the top each printed page or screen.
  67.                 
  68.                 page_bottom - specifies that the following functions are
  69.                 to the executed at the  bottom  of  each printed page or
  70.                 screen.
  71.                 
  72.                 report_top - specifies that the  following functions are
  73.                 to be executed  only  at  the  beginning  of  the output
  74.                 report.
  75.                 
  76.                 report_bottom - specifies  that  the following functions
  77.                 are to executed only at the end of the report.
  78.                 
  79.                 top(<data-name>)   -   specifies   that   the  following
  80.                 functions are to  be  executed  after  there  has been a
  81.                 change in the  content  of  <data-name>.   For  example,
  82.                 top(Article).  Normally, the specified data-name will be
  83.                 the same as the sort sequence.
  84.                 
  85.                 bottom(<data-name>)  -   specifies  that  the  following
  86.                 functions are to be executed before there is a change in
  87.                 the    content     of     data-name.     For    example,
  88.                 bottom(Category).
  89.                 
  90.                 detail - specifies that the  following  functions are to
  91.                 be executed for each selected database entry.
  92.                 
  93.        What To Do:
  94.        
  95.                 print - specifies that all output is to be routed to the
  96.                 printer.
  97.                 
  98.                 display - specifies that  all  output is to be routed to
  99.                 the screen.  "Display" is the output default.
  100.                 
  101.                 <data-name> -  causes  the  specified  data  name  to be
  102.                 printed or displayed.  For  example,  "Condition"  is  a
  103.                 data-name.
  104.                 
  105.                 "literal" - causes the  specified  literal to be printed
  106.                 or  displayed.   For  example,  "The  result  is:"  is a
  107.                 literal.
  108.                 
  109.                 total(<data-name>) - specifies  that the summed value of
  110.                 <data-name> is to be  printed  or displayed.  An numeric
  111.                 data item  from the  dictionary  must be substituted for
  112.                 "<data-name>, e.g., Orig.
  113.                 
  114.                 col nn - causes the following  data item to be displayed
  115.                 or printed in the column specified by nn.
  116.                 
  117.                 skip n - causes n lines to be  skipped before displaying
  118.                 or printing the next data item.  If n is not provided, 1
  119.                 is assumed.
  120.                 
  121.                 pause - causes a pause in the output process until a key
  122.                 (any key) is depressed.
  123.                 
  124.                 eject - if "print"  has  been  specified,  this  command
  125.                 causes the paper to be  ejected  to  the top of the next
  126.                 page; otherwise, the screen will be cleared.
  127.                 
  128.                 
  129.                 EDITING MASKS
  130.                 
  131.                 Editing Masks may be used to cause predefined characters
  132.                 to be  imbedded  within  displayed  or  printed  numeric
  133.                 values.    The   masks   must   be   constructed  as  an
  134.                 alpha-numeric literal whose first  character is "%".  If
  135.                 the second character of  the  mask  literal     is other
  136.                 than a numeric character, that  character will be placed
  137.                 in the next left  most  position  before  the  resulting
  138.                 edited numeric value.
  139.                 
  140.                 Examples:
  141.                 
  142.                      Input Values       Mask         Output
  143.                 
  144.                          01000        "%9,999"        1,000
  145.                 
  146.                          25245      "%$99,999"      $25,245
  147.                 
  148.                          -5643     "%$999,999"      $-5,643
  149.                 
  150.        
  151.        Here is an example of a more complex query construction:
  152.        
  153.        
  154.        SELECT:
  155.        (Description  = "gold" or "silver") and Orig >= 100
  156.        
  157.        
  158.        SORT:
  159.        Article
  160.        
  161.        
  162.        REPORT:
  163.        bottom(Article) Article total(Orig) "%$99,999" report_bottom skip
  164.        1 col 5 "Total " col 22 total(Orig) "%$99,999"
  165.        
  166.        This query will display the total original value for each article
  167.        type and display an overall total value at the end of the report.
  168.        
  169.        Rules:
  170.        
  171.             (1)  The Select statement may contain these operators:
  172.        
  173.                     =  Equal to
  174.                     <> Unequal to
  175.                     <  Less than
  176.                     >  Greater than
  177.                     <= Less than or equal to
  178.                     >= Greater than or equal to
  179.        
  180.             (2)  The field on the left side  of  the  operator must be a
  181.        data name from the dictionary.
  182.        
  183.             (3)  The field on the  right  side  of  the  operator may be
  184.        either a data name or  literal.    Literals  must  be enclosed in
  185.        double quotes.
  186.        
  187.             (4)  In the case of equal and unequal,  the data name on the
  188.        left side of the operator is searched  for any occurrences of the
  189.        data specified on the right of the operator.
  190.        
  191.             (5)  The length of the item to the right of the operator may
  192.        not be greater than the  length  of  the  item to the left of the
  193.        operator.
  194.        
  195.             (6)  When used in a literal, the "?"  is wild.  For example,
  196.        to select all records in the database enter:
  197.        
  198.                    SELECT:
  199.                    Article = "?"
  200.        
  201.             (7)  Commas may used to improve readability; otherwise, they
  202.        serve no useful purpose.
  203.        
  204.             (8)  All data names must be capitalized.  All other commands
  205.        must be in lower case.
  206.        
  207.        If your printer carriage is 80 columns in width, try setting your
  208.        printer preferences for compressed mode in order to print reports
  209.        that are greater than 80 characters in width.
  210.